<h1>Listing warehouses</h1>

<table>
  <tr>
    <th>Name</th>
    <th>Street</th>
	<th>City</th>
    <th>Postal code</th>
	<th>Country</th>
    <th>Area</th>
  </tr>
  <% form_tag :action => 'filter' do %></td>
  <tr>
    <td><%= text_field("filter", "warehouse_name", :size => 25) %></td>
	<td><%= text_field("filter", "warehouse_street", :size => 32) %></td>
	<td><%= text_field("filter", "warehouse_city", :size => 15) %></td>
	<td><%= text_field("filter", "warehouse_postal_code", :size => 10) %></td>
	<td><%= text_field("filter", "warehouse_country", :size => 15) %></td>
	<td><%= text_field("filter", "warehouse_area", :size => 10, :value => 'ignore') %></td>
    <td><input type="submit" value="Filter" /></td>
  </tr>
  <%end%>
<% @warehouses.each do |warehouse| %>
  <tr>
    <td><%=h warehouse.name %></td>
    <td><%=h warehouse.street %></td>
    <td><%=h warehouse.city %></td>
    <td><%=h warehouse.postal_code %></td>
    <td><%=h warehouse.country %></td>
    <td><%=h warehouse.area %></td>
	<td/>
    <td><%= link_to 'Show', warehouse %></td>
    <td><%= link_to 'Edit', edit_warehouse_path(warehouse) %></td>
    <td><%= link_to 'Delete', warehouse, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New warehouse', new_warehouse_path %>